package com.guaoran.interview.before.designPatterns;

/**
 * @author : guCheng
 * @title : Proxy 
 * @Description : 
 * 	 代理模式
 * @date :2018年3月11日下午8:35:32
 */
public class Proxy implements ProxySourceable{
	private ProxySource proxySource;
	public Proxy (){
		super();
		proxySource = new ProxySource();
	}
	@Override
	public void method() {
		after();
		proxySource.method();
		before();
	}
	public void after(){
		System.out.println("after...");
	}
	public void before(){
		System.out.println("before...");
	}
	public static void main(String[] args) {
		ProxySourceable proxy = new Proxy();
		proxy.method();
	}
}
